package com.bawei.test

import android.app.Application
import com.bawei.test.loadsir.EmptyCallback
import com.bawei.test.loadsir.ErrorCallback
import com.bawei.test.loadsir.LoadingCallback
import com.bawei.test.loadsir.TimeoutCallback

import com.kingja.loadsir.core.LoadSir
import com.tencent.bugly.crashreport.CrashReport


/**
 * @Author : yaotianxue
 * @Time : On 2023/5/22 15:27
 * @Description : App
 */
class App:Application() {
    override fun onCreate() {
        super.onCreate()
        //bugly
        CrashReport.initCrashReport(getApplicationContext(), "4bc563357e", false);
        //loadSir
        LoadSir.beginBuilder()
            .addCallback(ErrorCallback()) //失败
            .addCallback(EmptyCallback()) //空
            .addCallback(LoadingCallback()) //加载中
            .addCallback(TimeoutCallback()) //链接超时
            .setDefaultCallback(LoadingCallback::class.java) //设置默认状态页
            .commit()
    }
}